//
//  UIFont+MAAdv.h
//  MateAdv
//
//  Created by 茶 on 2023/9/8.
//

#import <UIKit/UIKit.h>
#import "CAUIModule.h"

NS_ASSUME_NONNULL_BEGIN

static inline UIFont* CAFontName(NSString *fontName, CGFloat size, BOOL scale){
    size = scale ? CARatioWidth(size) : size;
    UIFont *font = [UIFont fontWithName:fontName size:size];
    if (!font) {
        font = [UIFont systemFontOfSize:size];
    }
    return font;
}

static inline UIFont* CAFontScaleLight(CGFloat size){
    return CAFontName(@"Ark Pixel 12px monospaced ja", size, YES);
}

static inline UIFont* CAFontScaleRegular(CGFloat size){
    return CAFontName(@"Ark Pixel 12px monospaced ja", size, YES);
}

static inline UIFont* CAFontScaleMedium(CGFloat size){
    return CAFontName(@"Ark Pixel 12px monospaced ja", size, YES);
}

static inline UIFont* CAFontScaleSemibold(CGFloat size){
    return CAFontName(@"Ark Pixel 12px monospaced ja", size, YES);
}


static inline UIFont* CAFontLight(CGFloat size){
    return CAFontName(@"Ark Pixel 12px monospaced ja", size, NO);
}

static inline UIFont* CAFontRegular(CGFloat size){
    return CAFontName(@"Ark Pixel 12px monospaced ja", size, NO);
}

static inline UIFont* CAFontMedium(CGFloat size){
    return CAFontName(@"Ark Pixel 12px monospaced ja", size, NO);
}

static inline UIFont* CAFontSemibold(CGFloat size){
    return CAFontName(@"Ark Pixel 12px monospaced ja", size, NO);
}

@interface UIFont (Addtion)

@end

NS_ASSUME_NONNULL_END
